export default {
    created() {
        const storageDataStr = sessionStorage.getItem(window.location.pathname);
        if(storageDataStr) this.storageData = JSON.parse(storageDataStr);
    },
    watch: {
        storageData: {
            handler: function(newVal) {
                console.log(window.location.pathname, JSON.stringify(newVal));
                if (newVal) {
                    sessionStorage.setItem(
                        window.location.pathname,
                        JSON.stringify(newVal)
                    );
                }
            },
            deep: true,
        },
    },
};
